package com.hxx.day2;

public class TestDemo11 {
    public static void main(String[] args) {
        //堆中创建了两个对象，父类对象和子类对象，无父及无子
        Emp emp = new Emp();
    }
}

class Person{
    private String name;
    private int age;

    public Person() {
        System.out.println("父类构造方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

class Emp extends Person{

    private int empId;

    public int getEmpId() {
        return empId;
    }

    public void setEmpId(int empId) {
        this.empId = empId;
    }
}